<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'requestdo.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
    <h1>登陆成功</h1>
     <% 
    	request.setCharacterEncoding("utf-8");
    	request.setAttribute("password", "123456");
    %>
	用户名：<%=request.getParameter("username") %><br>
	爱好：<%
			String[] favorites=request.getParameterValues("favorite");
			for(int i=0;i<favorites.length;i++){
				out.println(favorites[i]+"&nbsp");
			}
		%><br>
	密码：<%=request.getAttribute("password") %><br>
	请求体的MIME类型：<%=request.getContentType() %><br>
	协议类型及版本号：<%=request.getProtocol() %><br>
	接受请求的服务器主机名：<%=request.getServerName() %><br>
	返回服务器受此请求所用的端口号：<%=request.getServerPort() %><br>
	返回字符编码方式：<%=request.getCharacterEncoding() %><br>
	返回请求体的长度：<%=request.getContentLength() %><br>
	返回发送此请求的客户端IP地址：<%=request.getRemoteAddr() %><br>
	返回虚拟路径的真实路径：<%=request.getRealPath("request.jsp") %><br>
	返回虚拟路径的真实路径：<%=request.getRealPath("request.jsp") %><br>
  </body>
</html>
